pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let parts: Vec<&str> = num_str.split('(').collect();
    let number = parts[0];
    let from_base = parts[1].trim_end_matches(')').parse::<u32>().expect("invalid input format");

    let mut ori_num = u32::from_str_radix(number, from_base).expect("invalid number string");

    if ori_num == 0 {
        return "0".to_string();
    }

    let mut ret = String::new();
    while ori_num > 0 {
        let a = ori_num % to_base;
        if a < 10 {
            ret.push((a as u8 + b'0') as char);
        } else {
            ret.push((a as u8 - 10 + b'a') as char);
        }
        ori_num /= to_base;
    }
    let s: String = ret.chars().rev().collect();
    // println!("num: {}, to_base: {}, result: {}", num_str, to_base, s);
    s
}